﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataModels.Controls
{
    class Button
    {
        bool buttonDown = false;
        bool buttonWasDown = false;
        TimeSpan clickLength = new TimeSpan(0);
        //const TimeSpan CLICK_SPEED = new TimeSpan(10000000 * 1);//1 Second

        public Button()
        {
            
        }

        public void pushButton()
        {
            if (!buttonWasDown)
            {
                clickLength = new TimeSpan(0);
                buttonDown = true;
                buttonWasDown = true;
            }

        }

        public void releaseButton()
        {
            buttonDown = false;
            buttonWasDown = false;
        }

        public void advanceButtonTime(TimeSpan advanceBy){
            if (buttonDown)
                clickLength += advanceBy;
        }
        public bool isButtonDown(){
            return buttonDown;
        }
        public TimeSpan getClickLength(){
            return clickLength;
        }

    }
}
